From d962360fa0e218d0e9f6f48b214a2428cb730464 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 17 Sep 2021 13:17:53 -0400 Subject: [PATCH] Fix glyph cache entry sizing The subpixel-positioned glyph extends on both sides. --- gsk/ngl/gsknglglyphlibrary.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gsk/ngl/gsknglglyphlibrary.c b/gsk/ngl/gsknglglyphlibrary.c index 8ddf1ab265..9c184ed0f7 100644 --- a/gsk/ngl/gsknglglyphlibrary.c +++ b/gsk/ngl/gsknglglyphlibrary.c @@ -290,9 +290,15 @@ gsk_ngl_glyph_library_add (GskNglGlyphLibrary *self, pango_extents_to_pixels (&ink_rect, NULL); if (key->xshift != 0) - ink_rect.width++; + { + ink_rect.x -= 1; + ink_rect.width += 2; + } if (key->yshift != 0) - ink_rect.height++; + { + ink_rect.y -= 1; + ink_rect.height += 2; + } width = (int) ceil (ink_rect.width * key->scale / 1024.0); height = (int) ceil (ink_rect.height * key->scale / 1024.0); -- 2.30.2